fix: validate $sequence as integer regardless of adapter ID type#811
fix: validate $sequence as integer regardless of adapter ID type#811
Conversation
The $sequence attribute is always an auto-incrementing integer,
regardless of the database adapter's ID type. When the Sequence
validator checks $sequence values (primary=true), it should always
use integer Range validation instead of applying the adapter's
ID type validation (e.g., UUID7 regex for MongoDB).
This fixes Query::equal('$sequence', [...]) returning 400 on
MongoDB adapters where getIdAttributeType() returns VAR_UUID7.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe Sequence validator's Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
$sequenceattribute is always an auto-incrementing integer, regardless of the database adapter's ID type$sequencevalues ($primary=true), it now always uses integer Range validation instead of applying the adapter's ID type validationQuery::equal('$sequence', [...])returning 400 on MongoDB adapters wheregetIdAttributeType()returnsVAR_UUID7Test plan
$sequencequeries work on MongoDB adapter (previously returned 400)$sequencequeries still work on SQL adapters (integer IDs)$idqueries are unaffected (still use adapter-specific validation)🤖 Generated with Claude Code
Summary by CodeRabbit